#include <iostream>
using namespace std;

template<typename Type, int size>
	Type min(Type (&r_array)[size]){
		Type min_val = r_array[0];
		for(int i = 1; i < size; ++i)
			if(r_array[i] < min_val)
				min_val = r_array[i];
		return min_val;
	}

double da[6] = {10.2, 7.1, 14.5, 3.2, 25.0, 16.8};
int ia[] = {10, 7, 14, 3, 25};
	
int main() {
	int i = min(ia);
	if(i != 3)
		cout << "??oops: integer min failed\n";
	else
		cout << "!!ol: integer min worked\n";
	
	double d = min(da);
	if(d != 3.2)
		cout << "??oops: double min() failed\n";
	else
		cout << "!!ok: double min() worked\n";
}
